%% improve dataset, partially parallelized version
% clear;
% load_settings;
% data = improveDataset('SANDBOX_RUN1', 'iter_model');
% 
% save([data_root 'clean_data/sr1_iter_improved.mat'], data);

% This is version 1! Manually jitters rects according to settings in
% load_settings
%% Use parallel version 
clear;
load_settings;
matlabpool;
% data = improveDatasetParallel('SANDBOX_RUN1', 'iter_model');

dataset_name = 'LIVE_MTURK';
baseline_name = 'iter_model';
baseline_mat_location = [trained_root baseline_name '.mat'];
orig_data = getData(dataset_name);
load(baseline_mat_location);
baseline.libsvmmodel = model;
baseline.model = model.w';

data_dims = size(orig_data);
data = improveDatasetParallel(orig_data(:),baseline, hogsize);

data = reshape(data, data_dims);
matlabpool close;
%%
save([data_root 'clean_data/live_iter_improved.mat'], 'data');

%% make overview imgs
%clear

%makeOverviewImgs('SR1_ITER_IMPROVED');
